<!DOCTYPE html>
<html lang="en">
<head>
<title>模型预览</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
html
{
	height: 100%;
}

body
{
    background-color: #ffffff;
    margin: 0px;
    height: 100%;
    color: #555;
    font-family: 'inconsolata';
    font-size: 15px;
    line-height: 18px;
    overflow: hidden;
}

h1
{
    margin-top: 30px;
    margin-bottom: 40px;
    margin-left: 20px;
    font-size: 25px;
    font-weight: normal;
}

h2
{
    font-size: 20px;
    font-weight: normal;
}

a
{
    color: #2194CE;
    text-decoration: none;
}

#panel
{
    position: fixed;
    left: 0px;
    width: 250px;
    height: 100%;
    overflow: auto;
    background: #fafafa;
    filter: alpha(Opacity=80);
    -moz-opacity: 0.5;
    opacity: 0.5;
}

#panel #content
{
    padding: 0px 20px 20px 20px;
}

#panel #content .link
{
    color: #2194CE;
    text-decoration: none;
    cursor: pointer;
    display: block;
}

#panel #content .selected
{
    color: #ff0000;
}

#panel #content .link:hover
{
    text-decoration: underline;
}

#viewer
{
    position: absolute;
    border: 0px;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    /* overflow: scroll; */
}

#button
{
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px;
    color: #fff;
    background-color: #555;
    opacity: 0.7;
}

#button:hover
{
    cursor: pointer;
    opacity: 1;
}

#modelname
{
    width: 95%;
    padding: 5px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    border: 1px solid #dedede;
}

#modelname:focus
{
    border: 1px solid #2194CE;
}


#panel li b
{
    font-weight: bold;
}

@media all and ( max-width: 840px )
{

    #panel
    {
        position: absolute;
        left: 0;
        top: 0;
        height: 480px;
        width: 100%;
        right: 0;
        z-index: 10000;
        overflow: hidden;
        border-bottom: 1px solid #dedede;
    }

    #content
    {
        position: absolute;
        left: 0;
        top: 90px;
        right: 0;
        bottom: 0;
        font-size: 17px;
        line-height: 22px;
        overflow: auto;
    }


    #panel.collapsed
    {
        height: 56px;
    }
}
</style>
<link href="./lib/editor/style.css" rel="stylesheet" />
</head>

<body>
<div id="app"></div>
<div id="viewer"></div>
<div class="right-model-div" id="sidebar" style="display: none;">
    <div class="right-model-list">
        <div class="model-list-title">模型列表</div>
        <ul class="model-list-conter" id="outliner"></ul>
    </div>
    <div class="right-model-list m-t30">
        <div class="model-list-title">OBJECT</div>
        <div class="right-model-type">
            <ul id="ViewPanel">
                <li>
                    <label>类型：</label><p id="li_type"></p>
                </li>
                <li>
                    <label>名字：</label><input type="text" id="li_name" class="right-model-input" style="width: 238px;">
                </li>
                <li>
                    <label>显示：</label>
                    <div class="on-off">
                        <input type="checkbox" name="sex" id="male" class="chooseBtn" />
                        <label for="male" class="choose-label"></label>
                    </div>
                </li>
                <li>
                    <div class="ldw">
                        <label>位置：</label>
                    </div>
                    <div class="ldw">
                        <div class="xz-div">
                            <span>x</span><i id="ipostion_xjia">+</i><input type="text" id="li_postionx" class="xz-j"><i id="ipostion_xjian">-</i>
                        </div>
                        <div class="xz-div">
                            <span>y</span><i id="ipostion_yjia">+</i><input type="text" id="li_postiony" class="xz-j"><i id="ipostion_yjian">-</i>
                        </div>
                        <div class="xz-div">
                            <span>z</span><i id="ipostion_zjia">+</i><input type="text" id="li_postionz" class="xz-j"><i id="ipostion_zjian">-</i>
                        </div>
                    </div>
                </li>
                <li>
                    <label>旋转：</label>

                    <div class="xz-div">
                        <span>x</span><i id="irotate_xjia">+</i><input type="text" id="li_rotatex" class="xz-j"><i id="irotate_xjian">-</i>
                    </div>
                    <div class="xz-div">
                        <span>y</span><i id="irotate_yjia">+</i><input type="text" id="li_rotatey" class="xz-j"><i id="irotate_yjian">-</i>
                    </div>
                    <div class="xz-div">
                        <span>z</span><i id="irotate_zjia">+</i><input type="text" id="li_rotatez" class="xz-j"><i id="irotate_zjian">-</i>
                    </div>
                </li>
                <li>
                    <label>缩放：</label>
                    <div class="on-off">
                        <input type="checkbox" name="sex" id="li_scalelock" class="chooseBtn" />
                        <label for="li_scalelock" class="choose-label"></label>
                    </div>
                    <div class="xz-div">
                        <span>x</span><i id="iscale_xjia">+</i><input type="text" id="li_scalex" class="xz-j"><i id="iscale_xjian">-</i>
                    </div>
                    <div class="xz-div">
                        <span>y</span><i id="iscale_yjia">+</i><input type="text" id="li_scaley" class="xz-j"><i id="iscale_yjian">-</i>
                    </div>
                    <div class="xz-div">
                        <span>z</span><i id="iscale_zjia">+</i><input type="text" id="li_scalez" class="xz-j"><i id="iscale_zjian">-</i>
                    </div>
                </li>
                <li>
                    <label>属性：</label>
                    <div class="xz-div">
                        <span>长</span><i id="property_length">+</i><input type="text" id="li_property_length" class="xz-j"><i id="property_length_xjian">-</i>
                    </div>
                    <div class="xz-div">
                        <span>宽</span><i id="property_width">+</i><input type="text" id="li_property_width" class="xz-j"><i id="property_length_yjian">-</i>
                    </div>
                    <div class="xz-div">
                        <span>高</span><i id="property_height">+</i><input type="text" id="li_property_height" class="xz-j"><i id="property_length_zjian">-</i>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</div>
    
<script src="./lib/jquery-3.3.1.min.js"></script>
<script src="./3dEngine.js"></script>

<script>
EngineInit("viewer");
var nameArray = ['1RV'];
var modelArray = [];
var currentIndex = 0;

SetClickMode(0);

var mmStr = new Array();
var moldName = sessionStorage.model_name;
mmStr = moldName.split("_");

AddModel('https://model.richtechcn.com/'+mmStr[currentIndex]+'/'+mmStr[currentIndex]+'List.json', 'testtag0');

//监听加载的事件
function OnLoadModelEnd(tag) {
	if(currentIndex < mmStr.length-1){
		currentIndex++;
		AddModel('https://model.richtechcn.com/'+mmStr[currentIndex]+'/'+mmStr[currentIndex]+'List.json', 'testtag'+currentIndex);
	}
	loadEdit(sessionStorage.model_url);
};


var lastid = '';
var cameraPos = '';
var clickpos = '';

//监听点击的坐标
function OnClickPosition(position) {
    var ss = position.toString().split(",");
    $("#txtpostionx").val(ss[6]);
    $("#txtpostiony").val(ss[7]);
    $("#txtpostionz").val(ss[8]);
}
   
function LoadModel() {
    $("#addmodel").toggle();
}
   
function getpostion() {
    SetClickMode(1);
}

function colsePostion() {
    SetClickMode(0);
    $("#addmodel").hide();
}
</script>
</body>
</html>
